/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package telaCadastros;

import managertelaCadastros.managerCadFilial;
import telasMensagem.MensagemConfirmacao;
import util.Mensagem;

/**
 *
 * @author fumio
 */
public class CadFilial extends javax.swing.JDialog {
    private static CadFilial cadFilial;
    private static managerCadFilial mnCadFilial;
    /**
     * Creates new form CadGeneric
     */
    public CadFilial(java.awt.Frame parent, boolean modal) {
        super(parent, modal);
        initComponents();
        this.setTitle("");
    }

    public static CadFilial getInstance(managerCadFilial managerCadFilial) {
        cadFilial = new CadFilial(null, true);
        mnCadFilial = managerCadFilial;
        return cadFilial;

    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel2 = new javax.swing.JPanel();
        btnConfirmar = new javax.swing.JButton();
        btnCancelar = new javax.swing.JButton();
        btnSair = new javax.swing.JButton();
        jPanel1 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        edtCodigo = new javax.swing.JTextField();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        edtCnpj = new javax.swing.JFormattedTextField();
        jLabel4 = new javax.swing.JLabel();
        edtIe = new javax.swing.JTextField();
        edtFantasia = new javax.swing.JTextField();
        jLabel5 = new javax.swing.JLabel();
        edtEmpresa = new javax.swing.JTextField();
        edtEndereco = new javax.swing.JTextField();
        edtNumero = new javax.swing.JTextField();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        edtBairro = new javax.swing.JTextField();
        edtComplemento = new javax.swing.JTextField();
        jLabel9 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        edtCodigoCidade = new javax.swing.JTextField();
        edtCidade = new javax.swing.JTextField();
        btnPesquisar = new javax.swing.JButton();
        jLabel11 = new javax.swing.JLabel();
        edtTelefone = new javax.swing.JFormattedTextField();
        edtUF = new javax.swing.JTextField();
        jLabel12 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

        jPanel2.setBorder(javax.swing.BorderFactory.createCompoundBorder(null, new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED)));
        jPanel2.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        btnConfirmar.setFont(new java.awt.Font("Ubuntu", 1, 18)); // NOI18N
        btnConfirmar.setText("Confirmar");
        btnConfirmar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnConfirmarActionPerformed(evt);
            }
        });
        jPanel2.add(btnConfirmar, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 5, 122, 76));

        btnCancelar.setFont(new java.awt.Font("Ubuntu", 1, 18)); // NOI18N
        btnCancelar.setText("Cancelar");
        btnCancelar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCancelarActionPerformed(evt);
            }
        });
        jPanel2.add(btnCancelar, new org.netbeans.lib.awtextra.AbsoluteConstraints(150, 5, 121, 76));

        btnSair.setFont(new java.awt.Font("Ubuntu", 1, 18)); // NOI18N
        btnSair.setText("Sair");
        btnSair.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnSairActionPerformed(evt);
            }
        });
        jPanel2.add(btnSair, new org.netbeans.lib.awtextra.AbsoluteConstraints(450, 10, 121, 76));

        jPanel1.setBorder(javax.swing.BorderFactory.createCompoundBorder(null, new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED)));
        jPanel1.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        jLabel1.setText("Código:");
        jPanel1.add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(15, 19, -1, -1));

        edtCodigo.setEditable(false);
        edtCodigo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                edtCodigoActionPerformed(evt);
            }
        });
        jPanel1.add(edtCodigo, new org.netbeans.lib.awtextra.AbsoluteConstraints(15, 42, 100, -1));

        jLabel2.setText("Fantasia:");
        jPanel1.add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 180, -1, -1));

        jLabel3.setText("CNPJ:");
        jPanel1.add(jLabel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 80, -1, -1));
        jPanel1.add(edtCnpj, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 100, 200, -1));

        jLabel4.setText("Inscrição Estadual:");
        jPanel1.add(jLabel4, new org.netbeans.lib.awtextra.AbsoluteConstraints(390, 80, -1, -1));
        jPanel1.add(edtIe, new org.netbeans.lib.awtextra.AbsoluteConstraints(390, 100, 210, -1));
        jPanel1.add(edtFantasia, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 200, 580, -1));

        jLabel5.setText("Empresa:");
        jPanel1.add(jLabel5, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 130, -1, -1));
        jPanel1.add(edtEmpresa, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 150, 580, -1));
        jPanel1.add(edtEndereco, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 250, 460, -1));
        jPanel1.add(edtNumero, new org.netbeans.lib.awtextra.AbsoluteConstraints(510, 250, 90, -1));

        jLabel6.setText("Endereço:");
        jPanel1.add(jLabel6, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 230, -1, -1));

        jLabel7.setText("Número");
        jPanel1.add(jLabel7, new org.netbeans.lib.awtextra.AbsoluteConstraints(510, 230, -1, -1));

        jLabel8.setText("Bairro:");
        jPanel1.add(jLabel8, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 280, -1, -1));
        jPanel1.add(edtBairro, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 300, 200, -1));
        jPanel1.add(edtComplemento, new org.netbeans.lib.awtextra.AbsoluteConstraints(400, 300, 200, -1));

        jLabel9.setText("Complemento:");
        jPanel1.add(jLabel9, new org.netbeans.lib.awtextra.AbsoluteConstraints(400, 280, -1, -1));

        jLabel10.setText("Cidade:");
        jPanel1.add(jLabel10, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 390, -1, -1));
        jPanel1.add(edtCodigoCidade, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 410, 60, -1));
        jPanel1.add(edtCidade, new org.netbeans.lib.awtextra.AbsoluteConstraints(140, 410, 360, -1));

        btnPesquisar.setText("P");
        jPanel1.add(btnPesquisar, new org.netbeans.lib.awtextra.AbsoluteConstraints(80, 410, 60, -1));

        jLabel11.setText("Telefone:");
        jPanel1.add(jLabel11, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 330, -1, -1));
        jPanel1.add(edtTelefone, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 350, 200, -1));
        jPanel1.add(edtUF, new org.netbeans.lib.awtextra.AbsoluteConstraints(510, 410, 90, -1));

        jLabel12.setText("UF:");
        jPanel1.add(jLabel12, new org.netbeans.lib.awtextra.AbsoluteConstraints(510, 390, -1, -1));

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 629, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 447, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void btnConfirmarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnConfirmarActionPerformed
        // TODO add your handling code here:


        if (Mensagem.confirmarCadastro("Filial")) {
            LimpaTela();
        }
    }//GEN-LAST:event_btnConfirmarActionPerformed

    private void btnCancelarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCancelarActionPerformed
        // TODO add your handling code here:
        LimpaTela();
    }//GEN-LAST:event_btnCancelarActionPerformed

    private void btnSairActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSairActionPerformed
        // TODO add your handling code here:
        this.dispose();
    }//GEN-LAST:event_btnSairActionPerformed

    private void edtCodigoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_edtCodigoActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_edtCodigoActionPerformed
    /**
     * @param args the command line arguments
     */
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnCancelar;
    private javax.swing.JButton btnConfirmar;
    public javax.swing.JButton btnPesquisar;
    private javax.swing.JButton btnSair;
    public javax.swing.JTextField edtBairro;
    public javax.swing.JTextField edtCidade;
    public javax.swing.JFormattedTextField edtCnpj;
    public javax.swing.JTextField edtCodigo;
    public javax.swing.JTextField edtCodigoCidade;
    public javax.swing.JTextField edtComplemento;
    public javax.swing.JTextField edtEmpresa;
    public javax.swing.JTextField edtEndereco;
    public javax.swing.JTextField edtFantasia;
    public javax.swing.JTextField edtIe;
    public javax.swing.JTextField edtNumero;
    public javax.swing.JFormattedTextField edtTelefone;
    public javax.swing.JTextField edtUF;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    // End of variables declaration//GEN-END:variables

    private void LimpaTela() {
        throw new UnsupportedOperationException("Not yet implemented");
    }
}
